#include <reg52.h>
#include <..\XC51.h>

void delay(unsigned int z)
{
	unsigned int x,y;
	for(x = z; x > 0; x--)
		for(y = 114; y > 0 ; y--);
}

int main()
{
	while(1)
	{
		while (left_dodge == 0 && right_dodge == 0)
		{
			stop();
		}
		while (left_dodge == 1 && right_dodge == 0)
		{
			left_turn();
		}
		while (left_dodge == 0 && right_dodge == 1)
		{
			right_turn();
			
		}
		while (left_dodge == 1 && right_dodge == 1)
		{
			advance();
			
		}
	}
}